package com.yanqu.road.server.cmd.banquet.party;

import com.yanqu.road.pb.banquet.BanquetProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.banquet.CrossPartyMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_CROSS_PARTY_MEMBER_LIST, desc = "")
public class CrossPartyMemberListCmd extends CrossCommand {
    private long userId;
    private String partyId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        userId = packet.getPlayerId();
        BanquetProto.BanquetMemberInfoReq req = BanquetProto.BanquetMemberInfoReq.parseFrom(packet.getBytes());
        partyId = req.getBanquetId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossPartyMgr.syncPartyMemberList(serverId, userId, partyId);
    }

    @Override
    public void sendData() {

    }
}
